package com.gz.spring.aop.homework.xml方式;

public class MyCal implements Cal {
    @Override
    public int cal1(int n) {
        //1+2+3+...+n
        if(n==1){
            return 1;
        }
        return n+cal1(n-1);
    }

    @Override
    public int cal2(int n) {
        //1*2*3*...*n
        if(n==1){
            return 1;
        }
        return n*cal2(n-1);
    }
}
